package cn.edu.tju.elm.repository;

import cn.edu.tju.elm.model.Business;
import org.springframework.data.jpa.repository.JpaRepository;

import java.util.List;

/**
 * ClassName: BussinessRepository
 * Package: cn.edu.tju.elm.repository
 * Description:
 *
 * @Author Niu Wenhang
 * @Create 2025/9/17 8:46
 * @Version 1.0
 */
public interface BusinessRepository extends JpaRepository<Business, Long> {
    List<Business> findByBusinessOwnerId(Long ownerId);
    
    // 查询所有未删除的店铺
    List<Business> findByDeletedFalse();
    
    // 根据店铺名称模糊查询
    List<Business> findByBusinessNameContainingAndDeletedFalse(String name);
    
    // 根据地址模糊查询
    List<Business> findByBusinessAddressContainingAndDeletedFalse(String address);
    
    // 根据订单类型查询
    List<Business> findByOrderTypeIdAndDeletedFalse(Long orderTypeId);
}
